const isProduction = process.env.NODE_ENV === 'production';

module.exports = {
	publicPath: '/',
	lintOnSave: true,
	productionSourceMap: false,
	parallel: require('os').cpus().length > 1,
	transpileDependencies: ['uni-simple-router'],

	css: {
		extract: isProduction,
		sourceMap: false
	},

	devServer: {
		// host: '192.168.0.100',
		port: 9000,
		open: false,
		compress: false,
		overlay: {
			warnings: false,
			errors: true
		},

		proxy: {
			'/dev': {
				// target: 'http://taoke.daihuo.com',
				// target: 'http://zfx-platform.xmonecode.com',
				target: 'http://121.37.166.7:99/api',
				// target: 'http://test_ccc.zhuandanku.com',
				// target: 'tool.zhuandanku.com',

				changeOrigin: true,
				pathRewrite: {
					'^/dev': ''
				}
			},
			'/pro': {
				target: 'http://test_ccc.zhuandanku.com',

				changeOrigin: true,
				pathRewrite: {
					'^/pro': '/api'
				}
			}
		}
	}
};